
/**
 * Date:2019年9月4日下午3:08:21
 * Copyright (c) 2019, www.bwbroad.com All Rights Reserved.
 *
*/

package com.xue.common.lock.autoconfigure;

import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

import com.xue.common.lock.DistributedLock;
import com.xue.common.lock.redis.RedisDistributedLock;

/**
 * Description: TODO <br/>
 * Date: 2019年9月4日 下午3:08:21 <br/>
 * 
 * @author xuejianxin
 */
@Configuration
@AutoConfigureAfter(RedisAutoConfiguration.class)
public class DistributedLockAutoConfiguration {

	@Bean
	@ConditionalOnBean(RedisTemplate.class)
	public DistributedLock redisDistributedLock(RedisTemplate<Object, Object> redisTemplate) {
		return new RedisDistributedLock(redisTemplate);
	}

}
